//
//  UIButton + Extension.swift
//  SFWeiBo
//
//  Created by 孙凡 on 16/4/9.
//  Copyright © 2016年 Edward. All rights reserved.
//

import UIKit


extension UIButton{

    convenience init(title:String, textColor:UIColor) {

        self.init()

        setTitle(title, forState: UIControlState.Normal)
        setTitleColor(textColor, forState: UIControlState.Normal)
        titleLabel?.textAlignment = NSTextAlignment.Center

        let image:UIImage = (UIImage(named: "common_button_white")?.stretchableImageWithLeftCapWidth(1, topCapHeight: 1))!

        setBackgroundImage(image, forState: UIControlState.Normal)

        sizeToFit()


    }


}